@ import static org.apache.commons.lang.StringEscapeUtils.escapeHtml
@args notes.model.User user, notes.model.Note note
@extends main(user)

<div class="btn-toolbar">
	<div class="btn-group">
		<a class="btn btn-primary" onclick="document.forms['edit'].submit();" title="ctrl+Enter"><i class="icon-ok"></i> Save</a>
	</div>
	<div class="btn-group">
		<a class="btn" href="/p/list"><i class="icon-backward"></i> Back</a>
	</div>
	<div class="btn-group">
		<button class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
			<i class="icon-minus"></i> Remove<span class="caret"></span>
		</button>
		<ul class="dropdown-menu">
			<li><a href="#" onclick="document.forms['delete'].submit();">Confirm remove</a></li>
		</ul>
	</div>
</div>

<form id="edit" name="input" action="/p/update/$note.getNoteKey().getId()" method="post">
    <div class="spacer">
		<textarea class="input-xlarge expanding" name="text" onkeypress="ctrlEnter(event, document.forms['edit']);" placeholder="Type something...">$escapeHtml(note.getText())</textarea>
	</div>
</form>

<form id="delete" name="input" action="/p/delete/$note.getNoteKey().getId()" method="post">
</form>